package eu.dominicum.ft.pd;

import eu.dominicum.ft.pd.mao.MakeFantasyTourConfigurationMAO;

/**
 * A configuration for the way scores a calculated.
 *
 * @author Harry Klerks
 * @since 2013M1
 */
public class FantasyTourConfiguration extends PersistentDomainObject {

    /**
     * The name of the configuration.
     */
    private String name;
    /**
     * The number of substitutes in a participant's list.
     */
    private Integer substitutesInListCount;
    /**
     * The number of riders in a participant's list.
     */
    private Integer ridersInListCount;

    /**
     * Should substitutes be used?
     */
    private Boolean substituteRiders;

    /**
     * The number of riders in a youth stage result.
     */
    private Integer ridersInYouthResultCount;

    /**
     * The number of riders in an overall stage result.
     */
    private Integer riderInOverallResultCount;

    /**
     * Protected constructor to satisfy JPA based repositories.
     */
    protected FantasyTourConfiguration() {

    }

    /**
     * .
     *
     * @return String
     */
    public final String getName() {
        return name;
    }

    /**
     * Make a FantasyTourConfiguration.
     *
     * @param makeFantasyTourConfigurationMAO
     *         -
     * @return FantasyTourConfiguration
     */
    public static FantasyTourConfiguration make(
            final MakeFantasyTourConfigurationMAO makeFantasyTourConfigurationMAO) {

        FantasyTourConfiguration newFantasyTourConfiguration = new FantasyTourConfiguration();

        newFantasyTourConfiguration.name = makeFantasyTourConfigurationMAO.getName();
        newFantasyTourConfiguration.ridersInListCount = makeFantasyTourConfigurationMAO.getRidersInListCount();
        newFantasyTourConfiguration.substitutesInListCount = makeFantasyTourConfigurationMAO.getSubstituteRidersInListCount();
        newFantasyTourConfiguration.substituteRiders = makeFantasyTourConfigurationMAO.getSubstituteRiders();
        newFantasyTourConfiguration.ridersInYouthResultCount = makeFantasyTourConfigurationMAO.getRidersInYouthResultCount();
        newFantasyTourConfiguration.riderInOverallResultCount = makeFantasyTourConfigurationMAO.getRidersInOverallResultCount();

        return newFantasyTourConfiguration;
    }

    @Override
    public final String toString() {

        StringBuilder stringBuilder = new StringBuilder("FantasyTourConfiguration={");
        stringBuilder.append("name=");
        stringBuilder.append(this.name);

        return stringBuilder.toString();
    }

    /**
     * .
     *
     * @return Integer
     */
    public final Integer getSubstitutesInListCount() {
        return substitutesInListCount;
    }

    /**
     * .
     *
     * @return Integer
     */
    public final Integer getRidersInListCount() {
        return ridersInListCount;
    }

    /**
     * Should riders that exit the tour be substituted?
     *
     * @return Boolean
     */
    public final Boolean getSubstituteRiders() {
        return substituteRiders;
    }

    /**
     * .
     *
     * @return Integer
     */
    public final Integer getRidersInYouthResultCount() {
        return ridersInYouthResultCount;
    }

    /**
     * .
     *
     * @return Integer
     */
    public final Integer getRiderInOverallResultCount() {
        return riderInOverallResultCount;
    }
}
